package com.example.springboot.controller;

import com.example.springboot.service.ArService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @auther: Wyz
 * @date: 2023/5/6 16:04
 * @return
 */
@RestController
public class ArController {

    @Resource
    private ArService arService;

    @GetMapping(value ="getsql",produces = "application/json;charset=utf-8")
    public String getsql(@RequestParam(value = "archTypeName", required = false)String archTypeName ,@RequestParam("sectName")String sectName){
        String getsql = arService.getsql(archTypeName, sectName);
        return getsql;
    }


    @GetMapping(value ="getFileId",produces = "application/json;charset=utf-8")
    public  List<Long> selectFileUrl(@RequestParam("sectName")String sectName){

        List<Long> longList = arService.selectFileUrl(sectName);
        return longList;
    }

    @GetMapping(value ="getdelSql",produces = "application/json;charset=utf-8")
    public  String delSql(@RequestParam("sectName")String sectName){

        String delSql = arService.delSql(sectName);
        return delSql;
    }

    @GetMapping(value ="delSoureFile",produces = "application/json;charset=utf-8")
    public  String delSoureFile(@RequestParam("sectName")String sectName){

        String delSql = arService.delSoureFile(sectName);
        return delSql;
    }

}
